package com.twu.biblioteca;

/**
 * Created by sahelig on 10/06/14.
 */
public class Book {
    private String title, author, year;

    public Book(String title, String author, String year) {
        this.title = title;
        this.author = author;
        this.year = year;

    }

    public String toString() {
        return title + " " + author + " " + year;
    }

    public String getbookTitle() {
        return title;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Book book = (Book) o;

        if (!author.equals(book.author)) return false;
        if (!title.equals(book.title)) return false;
        if (!year.equals(book.year)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = title.hashCode();
        result = 31 * result + author.hashCode();
        result = 31 * result + year.hashCode();
        return result;
    }

    public String getBookAuthor() {
        return author;
    }

    public String getBookYear() {
        return year;
    }
}
